package de.jowadroid.timekeeping.database;

import java.util.List;

public interface IWorktimeDataAccess {

	/**
	 * Gets the whole working data from data source structured per calendar
	 * week.
	 * 
	 * @param x
	 *            Amount of weeks from today.
	 * @return Worktime per week in form HH:MM.
	 */
	public String getWeeklyWorktimeFromLastXWeeks(int x);

	/**
	 * Gets the current working time starting on Monday until last stop tag.
	 */
	public String getWortktimeForCurrentWeek();

	/**
	 * Doesn't check if timestamp is valid.
	 * @param timestamp 
	 */
	public boolean saveTimestamp(Timestamp timestamp);

	/**
	 * Checks if the last database entry is a start timestamp.
	 * 
	 * @return true if last entry is start timestamp otherwise false. Returns
	 *         false if no data is in database, too.
	 */
	public boolean isLastEntryStartTime();
	
	/**
	 * Deletes all data sets in the database.
	 * 
	 * @return true if operation was successful.
	 */
	public boolean deleteAllData();
	
	/**
	 * Returns a list of all stored timestamps
	 * 
	 * @return list of timestamps or empty list if an error occurs during data
	 *         retrieval
	 */
	public List<Timestamp> getTimestamps();

	public void addDataAccessListener(IDataAccessListener listener);
	
	public void removeDataAccessListener(IDataAccessListener listener);
}
